<div class="container">



    <div class="logo"><a href="./index.html">中检集团-PC端</a></div>



    <div class="left_open">



        <i title="展开左侧栏" class="iconfont">&#xe699;</i>



    </div>



    <ul class="layui-nav right" lay-filter="">



      <li class="layui-nav-item">



        <a href="javascript:;">{$admininfo.account}</a>



        <dl class="layui-nav-child"> <!-- 二级菜单 -->


          <dd><a href="javascript:;" onclick="xiugai()">修改密码</a></dd>
          <dd><a href="{:url('Login/bey')}">退出</a></dd>



        </dl>



      </li>



      <!-- <li class="layui-nav-item to-index"><a href="/">前台首页</a></li> -->



    </ul>



</div>

<script>
    //页面层
    function xiugai(){
        layer.open({
          type: 1,
          skin: 'layui-layer-rim', //加上边框
          area: ['420px', '340px'], //宽高
          content: '<div class="x-body"><div class="layui-form-item"><label for="L_pass" class="layui-form-label"><span class="x-red">*</span>原密码</label><div class="layui-input-inline"><input type="password"  name="oldpass" id="oldpass" required="required" lay-verify="pass" autocomplete="off" class="layui-input"></div></div><div class="layui-form-item"><label for="L_pass" class="layui-form-label"><span class="x-red">*</span>新密码</label><div class="layui-input-inline"><input type="password" name="pass" id="pass" required="required" lay-verify="pass" autocomplete="off" class="layui-input"></div></div><div class="layui-form-item"><label for="L_repass" class="layui-form-label"><span class="x-red">*</span>确认密码</label><div class="layui-input-inline"><input type="password" name="repass" id="repass" required="required" lay-verify="repass" autocomplete="off" class="layui-input"></div></div><div class="layui-form-item"><label for="L_repass" class="layui-form-label"></label><button  class="layui-btn" lay-filter="add" lay-submit="" onclick="tijiao()">确认修改</button></div></div>'
        });
    }

</script>


<script>
    function tijiao(){
            var oldpass = $('#oldpass').val();
            var pass = $('#pass').val();
            var repass = $('#repass').val();
            $.ajax({
                url: "{:url('Login/doedit')}",
                type: "post",
                data: {oldpass:oldpass,pass:pass,repass:repass},
                datatype: "json",
                success: function (data) {
                    if (data == 1){
                        layer.msg('原密码错误', function(){});
                    }else if(data == 2){
                        layer.msg('两次密码不一致', function(){});
                    }else if(data == 3){
                        layer.msg('修改成功', {icon: 1,time: 1500});

                            setTimeout(function(){
                              layer.closeAll();
                            
                            },1500);
                       
                       
                    }else if (data == 0) {
                        layer.msg('系统错误，请稍后重试', function(){});
                    }else if (data == 4) {
                        layer.msg('必填项不能为空', function(){});
                    }
                }
            })
    }
</script>



